﻿<UserControl x:Class="Sample.SecondaryWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:multiwindow="clr-namespace:Silverlight.Windows.Controls;assembly=Silverlight.Windows.Controls"
    d:DesignHeight="128" d:DesignWidth="256">
    
    <Grid x:Name="LayoutRoot" Background="Orange">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/><ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/><RowDefinition/>
        </Grid.RowDefinitions>
        <Button Template="{x:Null}" Grid.Column="1" Grid.Row="0" Margin="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="button1_Click">
            <Button.Content>
                <Grid Background="Red">
                    <TextBlock Text="Child Window" Foreground="White" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="8" TextWrapping="Wrap"/>
                </Grid>
            </Button.Content>
        </Button>
        <Button Template="{x:Null}" Grid.Column="0" Grid.Row="1" Margin="8" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Command="{Binding}">
            <Button.Content>
                <Grid Background="Green">
                    <TextBlock Text="Context Menu" Foreground="White" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="8" TextWrapping="Wrap"/>
                </Grid>
            </Button.Content>
            <multiwindow:ContextMenuService.ContextMenu>
                <multiwindow:ContextMenuWindow>
                    <multiwindow:MenuItem Header="Item 1" Command="{Binding}" CommandParameter="1"/>
                    <multiwindow:MenuItem Header="Item 2" Command="{Binding}" CommandParameter="2"/>
                    <multiwindow:MenuItem Header="Item 3" Command="{Binding}" CommandParameter="3"/>
                    <multiwindow:MenuItem Header="Item 4" Command="{Binding}" CommandParameter="4"/>
                    <multiwindow:MenuItem Header="Item 5" Command="{Binding}" CommandParameter="5"/>
                    <multiwindow:MenuItem Header="Item 6" Command="{Binding}" CommandParameter="6"/>
                    <multiwindow:MenuItem Header="Item 7" Command="{Binding}" CommandParameter="7"/>
                    <multiwindow:MenuItem Header="Item 8" Command="{Binding}" CommandParameter="8"/>
                </multiwindow:ContextMenuWindow>
            </multiwindow:ContextMenuService.ContextMenu>
        </Button>
    </Grid>
</UserControl>
